import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:goumao_app/Customs/gm_app_util.dart';
import 'package:goumao_app/Customs/my_button.dart';

class GMEmptyPage extends StatelessWidget {
  final String title;
  final String? emptyDes;

  const GMEmptyPage({super.key, required this.title, this.emptyDes});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: title.isNotEmpty
            ? AppBar(
                elevation: 0,
                title: GMAppUtil.navText(title),
              )
            : null,
        body: SafeArea(
            child: SizedBox(
          width: ScreenUtil().screenWidth,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              GMMyButton(
                  text: emptyDes != null ? emptyDes! : "暂无数据",
                  image: Image.asset(
                    "assets/images/gm_no_data_icon@2x.png",
                    width: 140,
                    height: 140,
                  ),
                  textStyle:
                      const TextStyle(color: Color(0xff888888), fontSize: 15),
                  direction: GMMyButtonDirection.top)
            ],
          ),
        )));
  }
}
